#include "connection.h"
#include <QtSql>



Connection::Connection()
{
}

/*connectToDatabase
   connects server to database
  */

void Connection::connectToDatabase()
{
    QSqlDatabase databse = QSqlDatabase::addDatabase("QMYSQL");

    databse.setHostName("localhost");
    databse.setDatabaseName("messenger");
    databse.setUserName("cs340");
    databse.setPassword("hello");
    bool ok = databse.open();
    if(!ok)
        qDebug("Error: %d", databse.lastError());
    else
        qDebug() << "Connection succesful";
}
